#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 
# Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
# 

"""
File: run5.py
Author: zhangyang(zhangyang40@baidu.com)
Date: 2018/1/5 0005 12:27
"""
"""
一只青蛙一次可以跳上1级台阶，也可以跳上2级……它也可以跳上n级。
求该青蛙跳上一个n级的台阶总共有多少种跳法
"""


class Solution:
    def jumpFloorII(self, number):
        if number == 0:
            return 0
        dp = []
        dp[0] = 1
        dp[1] = 1
        for i in range(2, number + 1):
            dp[i] = 0
            for j in range(0, i):
                dp[i] += dp[j]
        return dp[number]
        # write code here
